home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / c / gcc / gempp19.zoo / gem++19 / src / gemuo.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-29  |  1.4 KB  |  69 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  This file is Copyright 1992,1993 by Warwick W. Allison.
  4. //  This file is part of the gem++ library.
  5. //  You are free to copy and modify these sources, provided you acknowledge
  6. //  the origin by retaining this notice, and adhere to the conditions
  7. //  described in the file COPYING.LIB.
  8. //
  9. /////////////////////////////////////////////////////////////////////////////
  10.  
  11. #include "gemuo.h"
  12. #include <osbind.h>
  13.  
  14. GEMuserobject::GEMuserobject(GEMform& f, int RSCindex) :
  15.     GEMobject(f,RSCindex)
  16. {
  17.     ub.ub_code=Handler;
  18.     ub.ub_parm=(long)this;
  19.     originalspec=GEMobject::ObjectSpecific();
  20.     originaltype=GEMobject::Type();
  21.     GEMobject::ObjectSpecific((int)&ub);
  22.     GEMobject::Type(G_USERDEF);
  23. }
  24.  
  25. GEMuserobject::~GEMuserobject()
  26. {
  27.     GEMobject::ObjectSpecific(originalspec);
  28.     GEMobject::Type(originaltype);
  29. }
  30.  
  31. int GEMuserobject::Handler(void* p)
  32. {
  33.     PARMBLK* pb=(PARMBLK*)p;
  34.  
  35.     if (pb->pb_currstate==pb->pb_prevstate) {
  36.         ((GEMuserobject*)pb->pb_parm)->Draw(pb);
  37.         return 0;
  38.     } else {
  39.         return ((GEMuserobject*)pb->pb_parm)->Change(pb);
  40.     }
  41. }
  42.  
  43. int GEMuserobject::Change(const PARMBLK* p)
  44. {
  45.     Draw(p);
  46.     return 0;
  47. }
  48.  
  49. int GEMuserobject::Type() const
  50. {
  51.     return originaltype;
  52. }
  53.  
  54. void GEMuserobject::Type(int t)
  55. {
  56.     originaltype=t;
  57. }
  58.  
  59. int GEMuserobject::ObjectSpecific() const
  60. {
  61.     return originalspec;
  62. }
  63.  
  64. void GEMuserobject::ObjectSpecific(int s)
  65. {
  66.     originalspec=s;
  67. }
  68.  
  69.